import axios from '@/libs/axios1'
let jsonHeaders = {
  'content-type': 'application/json;charset=UTF-8'
}
let base ='/testplatform/productVulnerability'
let baseProduct = '/testplatform/productPart'
let baseLeak = '/testplatform/testVulnerabilityLog'

// 评估测试漏洞
export const estimateVulnerability = data =>{
  return axios({
    url: `${base}/estimate`,
    method: 'put',
    data,
    headers: jsonHeaders
  })
}

export const queryProductVulnerability = params => {
  return axios({
    url: `${base}`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}

export const queryVulnerabilityListNew = params => {
  return axios({
    url: `${base}/getPage`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}
export const deleteProductVulnerability = id => {
  return axios({
    url: `${base}/${id}`,
    method: 'DELETE',
    headers: jsonHeaders,
  })
}
// 查询部件或者组件详情
export const getModuleDetail = moduleId => {

  return axios({
    url: `${baseProduct}/getModuleDetail/${moduleId}`,
    method: 'GET',
    headers: jsonHeaders,
  })
}
// 查询漏洞日志列表
export const queryVulnerabilityLogList = params => {
  return axios({
    url: `${baseLeak}`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}
